package com.swak.frame.config;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

import com.swak.frame.aware.SwakAwareProcessor;
import com.swak.frame.logger.SwakLoggerFactory;
import com.swak.frame.system.SystemConfigurable;

@Configuration(proxyBeanMethods = false)
@Order(1)
public class SystemConfigAwareProcessor implements SwakAwareProcessor {

    private Logger logger = SwakLoggerFactory.getLogger(getClass());

    @Resource
    private SystemConfigurable systemConfig;

    @Override
    public void processor() {
        StringBuilder strBuff = new StringBuilder();
        strBuff.append("当前systemConfig配置 ：");
        strBuff.append(" - 当前环境-sysEnv : ").append(systemConfig.getEnv());
        strBuff.append(" - 当前机房-runZone : ").append(systemConfig.getRunZone());
        strBuff.append(" - runAlias: ").append(systemConfig.getRunAlias());
        strBuff.append(" - 业务名称-bizName : ").append(systemConfig.getBizName());
        strBuff.append(" - job标识-runJob : ").append(systemConfig.isRunJob());
        strBuff.append(" - Mq类型-mqType : ").append(systemConfig.getMqType());
        strBuff.append(" - appName : ").append(systemConfig.getAppName());
        strBuff.append(" - jdosAppName : ").append(systemConfig.getJdosAppName());
        logger.warn(strBuff.toString());
    }
}
